package com.henu.engineer.dao.mapper.student

import com.henu.engineer.dao.entity.student.CourseGoalAchieved
import org.apache.ibatis.annotations.Mapper
import org.springframework.stereotype.Repository

/**
 * 学生课程目标达成度统计表
 *
 * @author noexcept
 * @date 2021/8/5 0:45
 */
@Mapper
@Repository
interface CourseGoalAchievedXmlMapper {
    fun insertSingle(courseGoalAchieved: CourseGoalAchieved): Boolean
    fun insertList(courseGoalAchievedList: List<CourseGoalAchieved>): Int
    fun deleteSingle(studentId: String, courseId: String, courseGoalId: Int): Boolean

    /**
     * 删除某学生的某课程的多个目标达成度
     *
     * @return 实际删除的个数
     */
    fun deleteListByCourseGoal(studentId: String, courseId: String, courseGoalIdList: List<Int>): Int
    fun updateSingle(studentId: String, courseId: String, courseGoalId: Int, achievedScale: Double): Boolean

    /**
     * 查询某学生的某课程所有课程目标达成度
     */
    fun selectByStudentIdCourseId(studentId: String, courseId: String): List<CourseGoalAchieved>

    fun selectByCourseId(courseId: String): List<CourseGoalAchieved>
}